#ifndef __DATABAS_H__
#define __DATABAS_H__
#include "objbase.h"
#include "json.hpp"

using Json = nlohmann::json;
void db_Init();
Json &objDbGet(const char *name);
class database : public objbase
{
private:
    std::map<std::string, Json> m_mapJsonObjectRef;
    int DbSync(CAgrcList *message, RspMsg *outmessage, int iModule, int iCmd);
    int DbInit(CAgrcList *message, RspMsg *outmessage, int iModule, int iCmd);
    void dbinit();

public:
    database(/* args */);
    ~database();
    int Process(CAgrcList *message, RspMsg *outmessage, int iModule, int iCmd);
    int Init();
    friend void db_Init();
    friend Json &objDbGet(const char *name);
};
#define DB_INIT() \
    db_Init()

#endif